//app.js
App({
  onLaunch: function () {
    // 展示本地存储能力
    // let logs = wx.getStorageSync('logs')
    let logs = []
    logs.unshift(Date.now())
    wx.setStorageSync('logs:', logs)
    // 登录
    // wx.login({
    //   success: res => {
    //     // 发送 res.code 到后台换取 openId, sessionKey, unionId
    //   }
    // })
    // 获取用户信息
    wx.getSetting({
      success: res => {
        if (res.authSetting['scope.userInfo']) {
          // 已经授权，可以直接调用 getUserInfo 获取头像昵称，不会弹框
          wx.getUserInfo({
            success: resInfo => {
              console.log("initUser:",resInfo.userInfo)
              let userInfo = {
                avatarUrl: resInfo.userInfo.avatarUrl,
                country: resInfo.userInfo.country,
                gender: resInfo.userInfo.gender,
                nickName: resInfo.userInfo.nickName,
                city: resInfo.userInfo.city,
                language: resInfo.userInfo.language,
                province: resInfo.userInfo.province,
                // __proto__: e.detail.userInfo.__proto__
              };
              this.globalData.userInfo = userInfo;
              // 可以将 resInfo 发送给后台解码出 unionId
              // 由于 getUserInfo 是网络请求，可能会在 Page.onLoad 之后才返回
              // 所以此处加入 callback 以防止这种情况
              // if (this.userInfoReadyCallback) {
              //   this.userInfoReadyCallback(resInfo)
              // }
            }
          })
        }
      }
    })
  },
  globalData: {
    userInfo: null,
    currentArea:{id:111,nm:"中国内地",py:"chineseneidi"},
    areaList:[
      {id:111,nm:"中国内地",py:"chineseneidi"},
      {id:112,nm:"中国香港",py:"chinesehongkong"},
      {id:113,nm:"中国台湾",py:"chinesetaiwan"},
      {id:114,nm:"美国",py:"america"},
      {id:115,nm:"日本",py:"japan"},
      {id:116,nm:"韩国",py:"korea"},
      {id:117,nm:"英国",py:"britain"},
      {id:118,nm:"法国",py:"france"},
      {id:119,nm:"德国",py:"germany"},
      {id:120,nm:"意大利",py:"italy"},
      {id:121,nm:"澳大利亚",py:"australia"},
      {id:122,nm:"荷兰",py:"netherlands"},
      {id:123,nm:"马来西亚",py:"malaysia"},
      {id:124,nm:"新加坡",py:"singapore"},
      {id:125,nm:"其他",py:"other"}
    ],
    cinemaList:[
      {
        "id":1,
        "nm":"保利万和奢享影城（京南第一巨幕）",
        "longitude": 116.533289,
        "latitude": 39.802412,
        "addr":"北京市大兴区经济技术开发区科创五街38号院龙玥城3层保利奢享影城",
        "distance": "900m",
        "cardPromotionTag":"开卡特惠，首单立减3元"
      },{
        "id":2,
        "nm":"CGV影城（亦庄店）",
        "longitude": 116.512134,
        "latitude": 39.790975,
        "addr":"北京市大兴区荣华街道大族广场S3三层",
        "distance": "300m",
        "cardPromotionTag":"开卡特惠，首单1张票最高立减6.1元"
      },{
        "id":3,
        "nm":"唐阁影城（亦庄华联力宝店）",
        "longitude": 116.501765,
        "latitude": 39.805707,
        "addr":"北京市大兴区荣华中路北8号 BHGMall北京华联力宝购物中心F4层",
        "distance": "1.9km",
        "cardPromotionTag":"开卡赠礼，享家庭特惠观影"
      },{
        "id":4,
        "nm":"华夏天合国际影城（次渠新城商厦店）",
        "longitude": 116.565814,
        "latitude": 39.799008,
        "addr":"北京市通州区台湖镇定海园二里15号楼新城商厦4层",
        "distance": "3.7km",
        "cardPromotionTag":"开卡特惠，南京照相馆等7部影片购票满减特惠"
      },{
        "id":5,
        "nm":"卢米埃影城（住总万科店）",
        "longitude": 116.460003,
        "latitude": 39.805732,
        "addr":"北京市大兴区忠凉路万科广场5层",
        "distance": "5.4km",
        "cardPromotionTag":"开卡立减，立减2元"
      },{
        "id":6,
        "nm":"华美国际影城（旧宫永辉店）",
        "longitude": 116.454746,
        "latitude": 39.814826,
        "addr":"北京市大兴区旧宫小红门路39号",
        "distance": "6km",
        "cardPromotionTag":"开卡特惠，首单1张票最高立减4.5元"
      }
    ],
    movieList:[
      {
        "id":1,
        "aid": 111, // 所属城市id
        "isMovieOn": true, // 是否正在热映， true:正在热映，false：即将上映
        "cinemaId": 1, // 所属影院id
        "backgroundColor":"red",
        "nm":"哪吒之魔童闹海",
        "img":"/packageA/static/data_imgs/nezha.jpg",
        "enm": 20981,
        "cat":"中国电影华表奖，神话传说",
        "star":"饺子",
        "rt":"2025 中国内地",
        "dur":"144",
        "wish": 23175,
        "scoreLabel": 9.6,
        "dra": "天劫之后，哪吒、敖丙的灵魂虽保住了，但肉身很快会魂飞魄散。",
        "videourl": "https://vd4.bdstatic.com/mda-rf1dc529p0u6r5pp/cae_h264/1748856410356209488/mda-rf1dc529p0u6r5pp.mp4", // 预告片
        "photos": ["/packageA/static/data_imgs/nezha_1.jpg","/packageA/static/data_imgs/nezha_2.jpg","/packageA/static/data_imgs/nezha_3.jpg"], // 剧照
      },{
        "id":2,
        "aid": 111, // 所属城市id
        "isMovieOn": false, 
        "cinemaId": 2, 
        "backgroundColor":"green",
        "nm":"时间之子",
        "img":"/packageC/static/data_imgs/time_child.jpg",
        "enm": 14199,
        "cat":"奇幻爱情",
        "star":"于奥，周铁男",
        "rt":"2025 中国内地",
        "dur":"166",
        "wish": 8682,
        "scoreLabel": 9.5,
        "dra": "冷面杀手十七与渔村少女千晓因神秘时轮结缘，一个想”离职“找自由，一个想”离岛“寻精彩，他们决定暂时合作成为”一日时轮搭子“，在繁华的大都会开启了一场有惊有喜的浪漫奇遇。",
        "videourl": "https://vd4.bdstatic.com/mda-resmx9sm92ri0bjb/540p/h264_cae/1748359714741265978/mda-resmx9sm92ri0bjb.mp4", // 预告片
        "photos": ["/packageC/static/data_imgs/time_child_1.jpg","/packageC/static/data_imgs/time_child_2.jpg","/packageC/static/data_imgs/time_child_3.jpg"], // 剧照
      },{
        "id":3,
        "aid": 112, // 所属城市id
        "isMovieOn": true, 
        "cinemaId": 1, 
        "backgroundColor":"purple",
        "nm":"食神",
        "img":"/packageC/static/data_imgs/shishen.jpg",
        "enm": 8662,
        "cat":"美食题材，都市喜剧",
        "star":"周星驰，李力持",
        "rt":"1996 中国香港",
        "dur":"151",
        "wish": 12518,
        "scoreLabel": 9.7,
        "dra": "史提芬.周在饮食界是享誉盛名的食神，但一直骄傲自大，唯利是图，不料被身边得力助手陷害，一夜间一无所有。",
        "videourl": "http://vd3.bdstatic.com/mda-qhb3jk3p7nb5t3rq/360p/h264/1723429894105355552/mda-qhb3jk3p7nb5t3rq.mp4", // 预告片
        "photos": ["/packageC/static/data_imgs/shishen_1.jpg","/packageC/static/data_imgs/shishen_2.jpg"], // 剧照
      },{
        "id":4,
        "aid": 111, // 所属城市id
        "isMovieOn": true, 
        "cinemaId": 1, 
        "backgroundColor":"#29A0CA",
        "nm":"人生开门红",
        "img":"/packageB/static/data_imgs/rskmh.jpg",
        "enm": 10652,
        "cat":"都市喜剧",
        "star":"常远，邓家佳，王耀庆",
        "rt":"2025 中国内地",
        "dur":"114",
        "wish": 9832,
        "scoreLabel": 9.3,
        "dra": "知名网红小海茉和其恋人兼老板秦天龙争吵之际，烤肠小贩周大江意外闯入，路人拍下三人同框照片。",
        "videourl": "https://vd4.bdstatic.com/mda-rde84n9pz1fx8mtf/cae_h264/1744695989160379722/mda-rde84n9pz1fx8mtf.mp4", // 预告片
        "photos": ["/packageB/static/data_imgs/rskmh_1.jpg","/packageB/static/data_imgs/rskmh_2.jpg","/packageB/static/data_imgs/rskmh_3.jpg","/packageB/static/data_imgs/rskmh_4.jpg"], // 剧照
      },{
        "id":5,
        "aid": 111, // 所属城市id
        "isMovieOn": true, 
        "cinemaId": 1, 
        "backgroundColor":"#1DBA3A",
        "nm":"长安三万里",
        "img":"/assets/data_imgs/changan3w.jpg",
        "enm": 8975,
        "cat":"历史故事，国漫电影",
        "star":"谢君伟，邹靖",
        "rt":"2023 中国内地",
        "dur":"167",
        "wish": 7468,
        "scoreLabel": 9.3,
        "dra": "安史之乱爆发后数年，吐蕃大军攻打西南。",
        "videourl": "https://vd2.bdstatic.com/mda-pk6hqntshtu5bsc2/360p/h264/1699361392007955948/mda-pk6hqntshtu5bsc2.mp4", // 预告片
        "photos": [], // 剧照
      },{
        "id":6,
        "aid": 111, // 所属城市id
        "isMovieOn": true, 
        "cinemaId": 1, 
        "backgroundColor":"#C2A147",
        "nm":"长津湖之水门桥",
        "img":"/assets/data_imgs/changjinhu_smq.jpg",
        "enm": 8718,
        "cat":"热血战争",
        "star":"吴京，易烊千玺，朱亚文，李晨",
        "rt":"2022 中国内地",
        "dur":"149",
        "wish": 15375,
        "scoreLabel": 9.7,
        "dra": "电影以抗美援朝战争第二次战役中的长津湖战役为背景，讲述了在结束了新兴里和下碣隅里的战斗之后，七连战士们又接到了更艰巨的任务......",
        "videourl": "https://vd3.bdstatic.com/mda-qc8hn493fhtqeysr/cae_h264/1710115811372144278/mda-qc8hn493fhtqeysr.mp4", // 预告片
        "photos": [], // 剧照
      },{
        "id":7,
        "aid": 114, // 所属城市id
        "isMovieOn": false, 
        "cinemaId": 1, 
        "backgroundColor":"#C2489D",
        "nm":"白雪公主",
        "img":"/assets/data_imgs/snow_white.jpg",
        "enm": 5732,
        "cat":"童话世界，音乐歌舞",
        "star":"瑞秋.齐格勒，安德鲁.伯纳普",
        "rt":"2025 美国",
        "dur":"109",
        "wish": 4632,
        "scoreLabel": 6.5,
        "dra": "善良的白雪公主因邪恶皇后的炉火惨遭杀害，仓皇逃入魔法森林。在那里她遇到了七个小矮人，共度了一段快乐时光。",
        "videourl": "https://vd3.bdstatic.com/mda-rau7u5h90txc37pa/cae_h264/1738149568951639121/mda-rau7u5h90txc37pa.mp4", // 预告片
        "photos": [], // 剧照
      }
    ],
  }
})